import { Component, ViewChild } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-zero',
  templateUrl: './zero.component.html',
  styleUrls: ['./zero.component.css'],
})
// 在构造函数内部声明router
export class ZeroComponent {
  constructor(private router: Router) {}
  jumpHero() {
    console.log(11);
    // 编程式导航
    this.router.navigateByUrl('/hero');
  }
  jumpPink() {
    // 路由传参
    this.router.navigateByUrl('/pink/11');
  }
}
